%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[11pt,tikz,border=1]{standalone}
\usepackage[default]{cjkfonts}
\usetikzlibrary{calc,positioning}

\input{../westernfonts}

\begin{document}
  \begin{tikzpicture}

    \foreach \x in {0,...,26}
      \coordinate (p\x) at (\x * 0.4,0);

    \foreach \x in {0,...,26}
      \draw (p\x) -- ++(0, 1);

    \coordinate (layer1bottom) at (5.2,1);
    \coordinate (layer2top) at (5.2,0);
    \node(layer1) [above,rectangle,draw,minimum width=11cm,inner sep=6pt] at (layer1bottom) {
      第一层，处理些简单的任务，例如按位求和
    };

    \node(layer2) [below,rectangle,draw,minimum width=11cm,inner sep=6pt] at (layer2top) {
      整合到更复杂的任务，例如数字相加
    };
    
    \coordinate (layer2bottom) at ($ (layer2top)-(layer2.north)+(layer2.south) $);

    \foreach \x in {0,...,26}
      \draw ($ (p\x)-(layer2.north)+(layer2.south)$) -- ++(0, -1);

    \coordinate (layer3top) at ($ (layer2bottom)-(0,1) $);

    \node(layer3) [below,rectangle,draw,minimum width=11cm,inner sep=6pt] at (layer3top) {
      整合成乘法
    };

    \node(input) [above=of layer1] {
      输入：x 和 y
    };
    
    \node(output) [below=of layer3] {
      输出：x.y
    };

    \coordinate (t0) at (layer1.north);
    \coordinate (t1) at (layer1.north east);
    \coordinate (t2) at (layer1.north west);
    \coordinate (i0) at (input.south);
    \coordinate (i1) at (input.south east);
    \coordinate (i2) at (input.south west);
    
    \draw (i0) to (t0);
    \foreach \x in {0.15,0.35,0.6,0.95}
      \draw ($ (i0)!\x!(i1) $) to ($ (t0)!\x!(t1) $);
    \foreach \x in {0.15,0.35,0.6,0.95}
      \draw ($ (i0)!\x!(i2) $) to ($ (t0)!\x!(t2) $);

    \coordinate (b0) at (layer3.south);
    \coordinate (b1) at (layer3.south east);
    \coordinate (b2) at (layer3.south west);
    \coordinate (o0) at (output.north);
    \coordinate (o1) at (output.north east);
    \coordinate (o2) at (output.north west);

    \draw (b0) to (o0);
    \foreach \x in {0.15,0.35,0.6,0.95}
      \draw ($ (b0)!\x!(b1) $) to ($ (o0)!\x!(o1) $);
    \foreach \x in {0.15,0.35,0.6,0.95}
      \draw ($ (b0)!\x!(b2) $) to ($ (o0)!\x!(o2) $);

  \end{tikzpicture} 
\end{document}
